global ny nx nz wi phii deni phi2 A3 %petilde %pii c X3

wi=sbcy(wi);
wi=sbcxnn3(wi);

% phi2 = phi + pii;
% phi2=phi;

% tei=pei./deni;
nx0=nx-2;%fix
ny0=ny-2;
nz0=nz-2;
cr=zeros(nx0,ny0);%fix

%%
    %内点赋值
    cr(1:nx0,1:ny0)= wi(2:nx0+1,2:ny0+1);
    %边界赋值
    cr(1,1:ny0)= wi(2,2:ny0+1);
    cr(nx0,1:ny0)= wi(nx0+1,2:ny0+1);
    %对cr矩阵沿第二维度（列）进行快速傅立叶变换(FFT)
    cr = fft(cr,[],2);
    %将二维的cr矩阵重塑为一维列向量
    cr=reshape(cr,[nx0*ny0,1]);
    x_sv=A3\cr;
    %x_sv=solve_tridiagonal(A3, cr);
    cr=reshape(x_sv,[nx0,ny0]);
    cr = ifft(cr,[],2);
    phi2(2:nx0+1,2:ny0+1)=real(cr(1:nx0,1:ny0));

phii=phi2;
phii=sbcy(phii);
